package com.xxg.socket;

/**
 *
 * Created by game group on 2020/12/23.
 */
public interface YmaServer {

    Object onOpen(YmaSession session);

    /**
     * 收到消息
     *
     * 默认未byte[]
     * @param session
     * @param message
     * @return
     */
    Object onMessage(YmaSession session,Object message);
    void onError(YmaSession session,Throwable e);
    Object onClose(YmaSession session);

    /**
     * 主动发信息
     * @param session
     * @param message
     */
    void send (YmaSession session,Object message);

    void onStart();
    void onStop();

    void start();
    void stop();
}
